'''
     存放一些工具类代码

'''
import os
import cv2
# test_3C21C 3通道图片转成1通道
def P3C21C():

    src_path = "D:\\Project\\CV\\mmlab\\data\BUSI\\ann_dir\\val_3c"
    des_path = "D:\\Project\\CV\\mmlab\\data\BUSI\\ann_dir\\val"

    if not os.path.exists(des_path):
        os.mkdir(des_path)

    img_list = os.listdir(src_path)
    for item in img_list:
        img_src_path = os.path.join(src_path,item)
        img = cv2.imread(img_src_path,0)
        img_des_path = os.path.join(des_path,item)
        cv2.imwrite(img_des_path,img)


if __name__ == '__main__':
    P3C21C()